package org.skipper.samples.mybatis.plus.crud.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;
import org.skipper.samples.mybatis.plus.crud.enums.GenderEnum;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 用户详情
 * </p>
 *
 * @author skipper
 * @since 2022-01-11
 */
@TableName("user_info")
@Accessors(chain = true)
@Data
public class UserInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;

    /**
     * 用户昵称
     */
    private String nickname;

    /**
     * 性别
     */
    private GenderEnum gender;

    //自动填充规则
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    //自动填充规则
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    //逻辑删除，默认值为0，删除之后为1
    @TableLogic(delval = "1", value = "0")
    private int isDeleted;

}
